<?php
class Pay_transaction {

	var $CI;

	public function __construct() {
		$this->CI =& get_instance();
	}

	public function pay_tran($tran_id,$account_no,$payment_fee) {
		$this->CI->load->model("mpay_transaction_model");
		$transaction['modified_time']	=date("Y-m-d H:i:s");
		$transaction['modified_by']		=$account_no;
		$transaction['pay_time']		=date("Y-m-d H:i:s");
		$transaction['tran_code']		="TR".date('YmdHis') . str_pad(mt_rand(1, 9999999), 7, '0', STR_PAD_LEFT);
		$transaction['account_no']		=$account_no;
		$transaction['pay_status']		=1;
		$transaction['payment_fee']		=$payment_fee;
		$this->CI->mpay_transaction_model->pay_transaction($transaction,$tran_id);
	}

}
